<?php
require_once('library.php');
try {
	$auth = Zend_Auth::getInstance();
	if ($auth->hasIdentity()){
		$identity = $auth->getIdentity();
		// Restrict access to inactive accounts
		$sql = "select accountStatus from accounts where id = ?";
		$accStatus = $dbRead->fetchOne($sql,$identity->accountId);
		if($accStatus != 1){
			header('Location: AccountDisabled.php');
			exit;
		}
	} else {
		header('Location: Index.php');
		exit;
	}
} catch (Exception $e){
	echo $e->getMessage();
}